<template>
<div class="qrcode">
  <div class="cl-module">
    <div class="cl-m-header">
      签到二维码
    </div>
    <div class="cl-m-body">
      <div class="outline">
        <img v-if="qrcode !== ''" :src="'data:image/png;base64, ' + qrcode">
      </div>
    </div>
  </div>
</div>
</template>

<script>
import {
  Tabbar,
  Cell,
  Group,
  Badge,
  XButton,
  XInput,
  Selector,
  XTextarea
} from 'vux'

export default {
  components: {
    Tabbar,
    Cell,
    Group,
    Badge,
    XButton,
    XInput,
    Selector,
    XTextarea
  },
  data () {
    return {
      qrcode: '',
      id: 0
    }
  },
  created () {
    var id = parseInt(this.$route.params.id)
    if (isNaN(id) || id < 0) {
      id = 0
    }
    this.id = id

    var url = 'http://wx.xinjijiaoyu.com/#/parent/course/sign/' + id
    this.$api.course.getQrcode(url)
        .then((qrcode) => {
          this.qrcode = qrcode
        })
  },
  methods: {
  }
}
</script>

  <style scoped lang="scss">
.progress {
  height: 6px;
  margin: 15px;
}
.temop {
  background-color: #60c9cf;
  height: 6px;
  border-radius: 3px;
}
.course {
  .temop {
    width: 50%;
  }
  hr {
    margin-bottom: 50px;
  }
  ul {
    list-style: none;
  }
  .cover {
    width: 225px;
  	height: 120px;
  	background-color: #efeff4;
    font-size: 24px;
    font-weight: 300;
    color:#fff;
    line-height: 120px;
  }
  .label {
    margin-bottom: 30px;
    font-size: 17px;
    li{
    line-height: 34px;
    }
  }
  .object {
    float: left;
    color: #00a6ac;
  }
  img {
    height: 120px;
    width: 225px;
  }
  .cl-module {
    padding-bottom: 30px;
    .cl-m-body {
      margin: 50px;
      .outline {
        text-align: center;
        input {
          text-align: center;
          border: none;
          height: 30px;
          width: 100%;
          margin-top: 10px;
          font-size:18px;
          margin-bottom: 15px;
        }
      }
    }
  }
}

.detail{
  color:#323b46;
}
</style>
